package lapsnake.model.stmt;

import lapsnake.model.*;
import lapsnake.model.data.*;
import lapsnake.model.misc.LapAlias;
import lapsnake.py.ast.ASTHelperFactory; import java.beans.PropertyVetoException;

import org.python.antlr.ast.*;

/**Wrapper class with helper functions for ImportFrom nodes*/
public class LapImportFrom extends LapStatement {
	public final VetoableProperty<String> module = new VetoableProperty<>(String.class);
	public final ChildList<LapAlias> names = new ChildList<>(this, LapAlias.class, false);
	public final VetoableProperty<Integer> level = new VetoableProperty<>(Integer.class);

    public LapImportFrom(PyAST pyAST, ChildField<? super LapImportFrom> parent, ImportFrom node) throws PropertyVetoException {
	super(pyAST, parent, node);
	
	module.setInternal(node.getInternalModule());
	ASTHelperFactory.makeHelpers(pyAST, names, node.getInternalNames());
	level.setInternal(node.getInternalLevel());
	
	buildTextNodes(node);
    }
}
